using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TestSystem.BLL.TestSystem;

public partial class TestNavigationPanel : System.Web.UI.UserControl
{
    private int quizID;
    public int QuizID
    {
        get { return quizID; }
        set { quizID = value; }
    }

    private Quiz _currentQuiz = null;
    private Quiz CurrentQuiz
    {
        get
        {
            if (_currentQuiz == null)
                _currentQuiz = Quiz.GetByQuizID(QuizID);
            return _currentQuiz;
        }
    }

    private int activeTestID;
    public int ActiveTestID
    {
        get { return activeTestID; }
        set { activeTestID = value; }
    }

    private List<Test> tests = null;
    public List<Test> Tests
    {
        get { return tests; }
        set { tests = value; }
    }

    private bool useTimer;
    public bool UseTimer
    {
        get { return useTimer; }
        set { useTimer = value; }
    }

    private int counter = 1;
    public int Counter
    {
        get
        {
            return counter++;
        }
    }
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            testNavi.DataSource = Tests;
            testNavi.DataBind();
            timer.TimePerQuiz = CurrentQuiz.TimePerQuiz;
            timer.Visible = UseTimer;
        }
    }
}
